<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	
<%@include file="/include/head.jsp"%>

<div id="cc" class="easyui-layout" style="width:100%;height:100%;">   
	<div data-options="region:'center',title:'送货单-<fmt:formatDate value="${vo.sendDate}" pattern="yyyy-MM-dd"/>信息'" style="padding:5px;background:#eee;">
		<form id="editForm"   method="post" enctype="multipart/form-data" >
			<input name="id" type="hidden" value="${vo.id}">
				<!-- 提交的时候存放子表订单明细信息 -->
				<input id="orderbData" name="orderbData" type="hidden" value="">
			<table cellpadding="0" cellspacing="1" class="formtable">
				<tr>
				<td align="right"><label class="Validform_label">送货日期:</label></td>
				<td class="value">
				<input class="easyui-datebox" type="text"  id="sendDate" name="sendDate"
				 data-options="required:true,readonly:true" value="<fmt:formatDate value="${vo.sendDate}" pattern="yyyy-MM-dd"/>" />
				</td>
				<td align="right"><label class="Validform_label">送货人:</label></td>
				<td class="value">
				<input class="easyui-textbox" type="text"  id="sender" name="sender"
				 data-options="required:true,readonly:true" value="${vo.sender}" />
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">备注:</label></td>
				<td class="value">
				<input class="easyui-textbox" type="text"  id="remark" name="remark"
				 data-options="required:true,readonly:true" value="${vo.remark}" />
				</td>
				<td align="right"><label class="Validform_label">状态:</label></td>
				<td class="value">
				<select id="status" class="easyui-combobox" name="status" style="width:200px;" data-options="required:true,readonly:true">  
				    <option value="0" <c:if test="${vo.status==0}"> selected="selected"</c:if>>草稿</option>   
					<option value="1" <c:if test="${vo.status==1}"> selected="selected"</c:if>>送货中</option>    
					<option value="2" <c:if test="${vo.status==2}"> selected="selected"</c:if> >配送完成</option> 
				</select>
				</td>
				</tr>
			</table>
		</form>
		<div id="tt" class="easyui-tabs" style="width:98%;height:400px;"> 
		 	<div title="订单明细" data-options="closable:false" style="overflow:auto;">   
	        	<table id="dg_orderb"> </table>    
	     	</div>   
		</div>
	</div>
	<div data-options="region:'south'" style="height:35px;text-align: center;padding-top: 5px">
	 	<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="edit()" >修改</a>  
	 	<a id="btncancel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="closeDialog()">关闭</a>  
	 </div>
</div>
<script type="text/javascript">
var dialog = frameElement.dialog;
$(function() {
	 
	    initCurdDatagrid4Sub('orderb','dg_orderb',{
			title:null,
			pagination:false,
			dwidth:'90%',//弹出对话框的宽度 百分比或者具体数字宽度
			dheight:'90%',//弹出对话框的高度 百分比或者具体数字宽度
			btnCtl:'',
			fitColumns:false,
			model:'${vo.id}'==''?'add':'edit',
			url:'${ctx}/platform/orderb/listAllData.do',
			width:'100%',
			remoteSort:false,
			loadFilter: function(data){
				return data;
			},
			queryParams:{'deliveryId':'${vo.id}'},
			baseUrl:'${ctx}/platform/orderb/',
			columns:[[
				        	{field:'orderhId',title:'订单头ID',width:100, hidden:true},    
				        	{field:'extOrderNo',title:'外部订单编号',width:100,sortable:true},    
				        	{field:'productId',title:'产品ID',width:100, hidden:true},    
				        	{field:'productName',title:'产品名称',width:100,sortable:true},    
				        	{field:'productSpec',title:'产品规格',width:100, hidden:true},    
				        	{field:'unit',title:'单位',width:40,sortable:true},    
				        	{field:'productNum',title:'数量',width:40,sortable:true,formatter:formatInt},    
				        	{field:'unitPrice',title:'单价',width:40,sortable:true,formatter:formatDouble},    
				        	{field:'totalPrice',title:'总价',width:60,sortable:true,formatter:formatDouble},    
				        	{field:'recvId',title:'收货地址ID',width:100, hidden:true},    
				        	{field:'area',title:'区域',width:50,sortable:true},
				        	{field:'recvName',title:'收货单位',width:100,sortable:true},    
				        	{field:'recvAdd',title:'收货地址',width:100,sortable:true},    
				        	{field:'recvContactor',title:'联系人',width:60,sortable:true},    
				        	{field:'recvTel',title:'收货电话',width:180,sortable:true},    
				        	{field:'isPlanSend',title:'是否安排送货',width:100,sortable:true,formatter:formatSendStatus},    
				        	{field:'sendDate',title:'送货日期',width:100,sortable:true,formatter:formatDate},    
				        	{field:'sendWay',title:'送货顺序',width:60,sortable:true },    
				        	{field:'deliveryman',title:'送货人',width:100,sortable:true},    
				        	{field:'isSigned',title:'是否签收',width:100,sortable:true},    
				        	{field:'signer',title:'签收人',width:100,sortable:true},    
				        	{field:'signDate',title:'签收日期',width:100,sortable:true,formatter:formatDate}    
				    ]] 
		},[]);
	  
});

function edit(){
	document.location.href='editForm.do?id=${vo.id}';  
}
function closeDialog()
{
	dialog.dialog("close");
}

</script>
